const request = require('../../utils/kzj.request.js');
/**
 * 每一个页面对应一个contoller
 */
class controllerM {
  //商品详情页
  goodsDetails(params) {
    return request.post(`/api/goods/goodsDetails`, params,false).then(res => res.data)
  }
  //设置云商品下架 (店铺端)
  setCloudLow(params) {
    return request.post(`/api/goods/setCloudLow`, params).then(res => res.data)
  }
  //设置云商品上架 (店铺端)
  setCloudUp(params) {
    return request.post(`/api/goods/setCloudUp`, params).then(res => res.data)
  }
  //获取商品评论列表
  goodsCommentPage(params) {
    return request.post(`/api/comment/goodsCommentPage`, params,false).then(res => res.data)
  }
  // 新增(商品/服务)
  saveGoods(params){
    return request.post(`/api/goods/saveGoods`,params).then(res => res.data)
  }

  //编辑(商品/服务)
  updateGoods(params){
    return request.post(`/api/goods/updateGoods`,params).then(res => res.data)
  }

  // 获取标签列表
  selectLabel(params){
    return request.post(`/api/label/selectLabel`,params,false).then(res => res.data)
  }

  // 活动专区优惠券
  activityPage(params){
    return request.post(`/api/coupon/activityPage`,params,false).then(res => res.data)
  }

  getShopCouponList(params){
    return request.post(`/api/coupon/couponList`,params,false).then(res => res.data)
  }
//获取开卡设置信息
  getMyOpenVip(params){
    return request.post(`/api/vip/getMyOpenVip`,params,false).then(res => res.data)
  }
  //更新会员开卡设置
  updateOpenVip(params){
    return request.post(`/api/vip/update`,params).then(res => res.data)
  }

  // 添加会员卡活动
  save(params){
    return request.post(`/api/vip/save`,params).then(res => res.data)
  }

  // 会员卡列表
  viplist(params){
    return request.post(`/api/vip/list`,params).then(res => res.data)
  }
  // 会员卡活动详情
  vipdetails(params){
    return request.post(`/api/vip/details`,params).then(res => res.data)
  }
  // 添加会员卡活动
  vipsave(params){
    return request.post(`/api/vip/save`,params).then(res => res.data)
  }

  // 会员卡列表 (店铺端)
  shopList(params){
    return request.post(`/api/vip/shopList`,params).then(res => res.data)
  }

  // 
  delGoods(params){
    return request.post(`/api/goods/delGoods`,params).then(res => res.data)
  }

  // 删除会员卡
  vipdelete(params){
    return request.post(`/api/vip/delete`,params).then(res => res.data)
  }

  // 获取优惠券列表
  shopActivityPage(params){
    return request.post(`/api/coupon/shopActivityPage`,params).then(res => res.data)
  }

  //获取用户的活动礼包优惠券列表
  accountActivityCouponPage(params){
    return request.post(`/api/coupon/accountActivityCouponPage`,params).then(res => res.data)
  }

  //激活优惠券
  awaken(params){
    return request.post(`/api/coupon/awaken`,params).then(res => res.data)
  }
  
  //判断权重是否重复
  judgeSort(params){
    return request.post(`/api/goods/checkSortRepeat`,params).then(res => res.data)
  }

  //获取折扣是否开启
  shopDiscount(params){
    return request.post(`/api/configure/shopDiscount`,params).then(res => res.data)
  }

  //设置首页展示
  setIndex(params){
    return request.post(`/api/shop/setIndex`,params).then(res => res.data)
  }

  //获取优惠券列表
  getCouponList(params){
    return request.post(`/api/coupon/accountCouponList`,params).then(res => res.data)
  }

  //核销优惠券
  writeOffCoupon(params){
    return request.post(`/api/coupon/writeOff`,params).then(res => res.data)
  }
  
  //获取用户账单
  // amountHistory(params){
  //   return request.post(`/api/transaction/lookAccountList`,params).then(res => res.data)
  // }

  //店铺查看用户会员卡列表
  checkLookVIPlist(params){
    return request.post(`/api/vip/lookAccountList`,params).then(res => res.data)
  }

  //店铺查看用户的优惠券列表
  lookAccountCouponList(params){
    return request.post(`/api/coupon/lookAccountCouponList`,params).then(res => res.data)
  }

  //给用户开卡
  accountOpenVip(params){
    return request.post(`/api/vip/accountOpenVip`,params).then(res => res.data)
  }

  
  //根据手机号查询用户
  selectByMobile(params) {
    return request.post(`/api/account/selectByMobile`, params).then(res => res.data)
  }

  //查看店铺员工提成统计记录
  shopStaffPage(params) {
    return request.post(`/api/transaction/shopStaffPage`, params).then(res => res.data)
  }

  //获取员工列表
  getStaffList(params){
    return request.post(`/api/shop/shopStaff`,params).then(res =>res.data)
  }

  //获取店铺员工提成统计
  shopStaffTotal(params){
    return request.post(`/api/transaction/shopStaffTotal`,params).then(res =>res.data)
  }

  //店铺自己新增的优惠券列表 2.0
  getShopActivityPage(params){
    return request.post(`/api/coupon/shopActivityPage`,params).then(res =>res.data)
  }

  //查看礼券包的优惠券详情 2.0
  getCouponDetail(params){
    return request.post(`/api/coupon/detail`,params).then(res =>res.data)
  }

  //用户购买礼包详情 2.0
  getAccountPayPage(params){
    return request.post(`/api/coupon/accountPayCouponPage`,params).then(res =>res.data)
  }

  //新增优惠券
  saveCoupon(params){
    return request.post(`/api/coupon/save`,params).then(res =>res.data)
  }

  //新增店铺爆款
  createHot(params){
    return request.post(`/api/bag/createHot`,params).then(res =>res.data)
  }

  //店铺新增爆款
  getshopBagPage(params){
    return request.post(`/api/bag/shopBagPage`,params).then(res =>res.data)
  }

  //获取店铺爆款的用户购买分页
  getAccountPayHotPage(params){
    return request.post(`/api/bag/accountPayHotPage`,params).then(res =>res.data)
  }

  //店铺爆款用户购买详情 2.0 6.4
  getAccountPayHotDetail(params){
    return request.post(`/api/bag/accountPayHotDetail`,params).then(res =>res.data)
  }

  //核销店铺爆款商品
  writeOffGoods(params){
    return request.post(`/api/bag/writeOffGoods`,params).then(res =>res.data)
  }

  //删除审核爆款
  delShopDelBag(params){
    return request.post(`/api/bag/shopDelBag`,params).then(res =>res.data)
  }

  //获取礼券包详情
  getActivityDetail(params){
    return request.post(`/api/bag/activityDetail`,params).then(res =>res.data)
  }

  //获取核销详情
  getWriteOffDetail(params){
    return request.post(`/api/bag/writeOffDetailByCode`,params).then(res =>res.data)
  }

  //核销店铺爆款
  writeOffGoodsByCode(params){
    return request.post(`/api/bag/writeOffGoodsByCode`,params).then(res =>res.data)
  }

  //核销一卡通券
  writeOffCouponByCode(params){
    return request.post(`/api/bag/writeOffCouponByCode`,params).then(res =>res.data)
  }

  
  //获取设计单张海报价格
  getDesignPosters(params){
    return request.post(`/api/renew/getDesignPosters`,params).then(res =>res.data)
  }

  //生成海报订单
  designPostersOrder(params){
    return request.post(`/api/order/designPostersOrder`,params).then(res =>res.data)
  }

   //定制店铺费用
   getDesignShop(params){
    return request.post(`/api/renew/getDesignShop`,params).then(res =>res.data)
  }

  //生成定制店铺订单
  createDesignShopOrder(params){
    return request.post(`/api/order/designShopOrder`,params).then(res =>res.data)
  }

  //查看核销码是否核销
  canWriteOff(params){
    return request.post(`/api/bag/canWriteOff`,params).then(res =>res.data)
  }

  //核销记录
  writeOffHistory(params){
    return request.post(`/api/bag/writeOffHistoryPage`,params).then(res =>res.data)
  }

  
  //套餐核销记录
  vipDeductionRecord(params){
    return request.post(`/api/vip/vipDeductionRecord`,params).then(res =>res.data)
  }

  //获取红包分配百分比
  getAccountPinFail(params){
    return request.post(`/api/commission/getAccountPinFail`,params).then(res =>res.data)
  }

   //创建红包订单
   redOrder(params){
    return request.post(`/api/order/redOrder`,params).then(res =>res.data)
  }

   //获取红包列表
   getRedBagList(params){
    return request.post(`/api/red/redList`,params).then(res =>res.data)
  }

  //支付成功
  paySuccess(params){
    return request.post(`/api/bug/paySuccess`,params).then(res =>res.data)
  }

  //获取用户领取红包列表
  getRedBagPeople(params){
    return request.post(`/api/red/giveRedList`,params).then(res =>res.data)
  }

  //获取用户领取红包列表
  getRedBagPeople(params){
    return request.post(`/api/red/giveRedList`,params).then(res =>res.data)
  }

  //创建超值抵扣券
  createTimeLimitCoupon(params){
    return request.post(`/api/bag/createLimited`,params).then(res =>res.data)
  }

  //获取分佣比例列表
  getShareProfitList(params){
    return request.post(`/api/commission/getProportion`,params).then(res =>res.data)
  }

   //用户购买的店铺商圈活动信息
   accountPayBagPage(params){
    return request.post(`/api/bag/accountPayBagPage`,params).then(res =>res.data)
  }

  //获取账单列表
  getTransactionList(params){
    return request.post(`/api/transaction/list`,params).then(res =>res.data)
  }

 

  // 消费/收入 累计
  payAndInput(value){
    return request.post("/api/transaction/consumeRecord",value).then(res => res.data)
  }

  //充值消费记录
  amountHistory(value){
    return request.post("/api/transaction/list",value).then(res => res.data)
  }

  // 获取自己的详细信息
  myInformation(params) {
    return request.post(`/api/account/myInformation`, params).then(res => res.data)
  }

  // 上传回复
  commentReply(params) {
    return request.post(`/api/comment/commentReply`, params).then(res => res.data)
  }

  //获取好友列表
  accountFriends(params) {
    return request.post(`/api/account/accountFriends`, params).then(res => res.data)
  }

  //解除绑定
  unbind(params) {
    return request.post(`/api/shop/unboundFriend`, params).then(res => res.data)
  }

  //更新店铺信息
  updateShopMsg(params) {
    return request.post(`/api/shop/updateShop`, params).then(res => res.data)
  }

  //获取交易详情
  getOrderDetail(params) {
    return request.post(`/api/order/orderDetail`, params).then(res => res.data)
  }

  //提交提现文案
  setBeanDesc(params) {
    return request.post(`/api/shop/setBeanDesc`, params).then(res => res.data)
  }

  //获取用户列表
  getUserList(params) {
    return request.post(`/api/shop/accountList`, params).then(res => res.data)
  }

  //获取提现申请列表
  getCashOutHistory(params) {
    return request.post(`/api/withdraw/shopAccountPage`, params).then(res => res.data)
  }

  //提现申请成功
  successBean(params) {
    return request.post(`/api/withdraw/successBean`, params).then(res => res.data)
  }

  //提现申请失败
  failBean(params) {
    return request.post(`/api/withdraw/failBean`, params).then(res => res.data)
  }

  //获取提现记录
  getCashHistory(params) {
    return request.post(`/api/withdraw/accountPage`, params).then(res => res.data)
  }

  //获取金币账单
  beanPage(params){
    return request.post(`/api/transaction/beanPage`,params).then(res => res.data)
  }

  //获取code信息
  getCodeMsg(params){
    return request.post(`/api/vip/getVipGoodsDetailByCode`,params).then(res => res.data)
  }

  //获取用户详情
  getAccountDetail(params){
    return request.post(`/api/shop/accountDetailById`,params).then(res => res.data)
  }

  //店铺赠送引流卡
  shopSendVip(params){
    return request.post(`/api/vip/shopSendVip`,params).then(res => res.data)
  }

  //获取赠送记录列表
  giveHistory(params){
    return request.post(`/api/vip/giveRecordPage`,params).then(res => res.data)
  }

  //删除优惠券
  delCoupon(params){
    return request.post(`/api/coupon/delete`,params).then(res => res.data)
  }

  //设置会员卡过期
  setCardOver(params){
    return request.post(`/api/vip/setOver`,params).then(res => res.data)
  }

  //获取用户优惠券列表
  userCouponList(params){
    return request.post(`/api/coupon/lookAccountCouponPage`,params).then(res => res.data)
  }

  //获取用户持有会员卡列表
  getUserVipCardList(params){
    return request.post(`/api/vip/myDetail`,params).then(res => res.data)
  }

  //获取标签列表
  getLabelList(params){
    return request.post(`/api/label/selectByTypeId`,params).then(res => res.data)
  }

  //根据权限获取员工列表
  selectStaffByPower(params){
    return request.post(`/api/shop/selectStaffByPower`,params).then(res => res.data)
  }

  //更新权限中的员工列表
  updateStaffPower(params){
    return request.post(`/api/shop/updateStaffPower`,params).then(res => res.data)
  }
  
  // 会员卡推送 1214
  pushVip(params){
    return request.post(`/api/vip/push`,params).then(res => res.data)
  }

  // 获取协议说明
  getListByTypes(params){
    return request.post(`/api/content/listByTypes`,params).then(res => res.data)
  }

  // vip卡购买分页信息
  vipPayPage(params){
    return request.post(`/api/vip/vipPayPage`,params).then(res => res.data)
  }

  // 编辑券包
  updateBag(params){
    return request.post(`/api/bag/updateHot`,params).then(res => res.data)
  }

  // 编辑限时抵扣
  updateLimited(params){
    return request.post(`/api/bag/updateLimited`,params).then(res => res.data)
  }

  //用户持有券详情 
  couponBagDetail(params) {
    return request.post(`/api/bag/accountDetail`, params).then(res => res.data)
  }

  //查看店铺爆款核销码是否核销  
  canWriteOffHot(params) {
    return request.post(`/api/bag/canWriteOffHot`, params).then(res => res.data)
  }

  //根据核销码核销店铺爆款   
  writeOffShopHot(params) {
    return request.post(`/api/bag/writeOffShopHotByCode`, params).then(res => res.data)
  }

  //核销数量统计   
  writeOffStatistics(params) {
    return request.post(`/api/shop/writeOffStatistics`, params).then(res => res.data)
  }

  
  //是否为店长   
  myShopIdentity(params) {
    return request.post(`/api/shop/myShopIdentity`, params).then(res => res.data)
  }

}
/**
 * 实例化对象
 */
let Controller = new controllerM();
/**
 * 暴露对象，无需每次都加函数名
 */
module.exports = {
  controller: Controller,
}